package com.example.reviewdemo.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.example.reviewdemo.bean.User;

@Dao
public interface UserDao {

    @Insert
    void insert(User user);

    @Query("SELECT * FROM User WHERE username=:username")
    User findByUsername(String username);

    @Query("UPDATE user SET password = :newPassword WHERE username = :username")
    int updatePasswordByUsername(String username, String newPassword);


}
